home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MEMORY.SWG / 0048_PhotoRAM.pas < prev    next >
Pascal/Delphi Source File  |  1994-01-27  |  2KB  |  60 lines

  1. {$A+,B-,D+,E+,F-,I-,L+,N-,O-,R+,S+,V+}
  2. {$M 2048,0,0}
  3. PROGRAM PhotoRAM(INPUT,OUTPUT);
  4.  
  5.    {Rob Rosenberger             VOX: (618) 632-7345
  6.     Barn Owl Software           BBS: (618) 398-5703
  7.     P.O. Box #74                HST: (618) 398-2305
  8.     O'Fallon, IL 62269          CIS: 74017,1344
  9.  
  10.    This program simply snapshots memory to disk.  It was developed so a user
  11. from across the country could take a snapshot of his memory configuration and
  12. present it for inspection.
  13.  
  14.    You'll need to change the "TotalRAM" constant if you have a system with
  15. less than 640k of memory.
  16.  
  17. Version 1.00: released to the public domain on 27 August 1989.
  18.    See above for the reason why this program was created.}
  19.  
  20.  
  21. CONST
  22.    TotalRAM = 640; {total memory, in kilobytes}
  23.  
  24. VAR
  25.    Index     : WORD;
  26.    PhotoFile : FILE;
  27.  
  28. BEGIN {PhotoRAM}
  29. {Initialize.}
  30. Index := 0;
  31.  
  32.  
  33. {Check for question mark, it means they want the help screen.}
  34. IF ((PARAMSTR(1) = '')
  35.  OR (PARAMSTR(1) = '?'))
  36.  THEN {display a help screen}
  37.     BEGIN
  38.     WRITELN(OUTPUT,^M^J'Syntax:   PHOTORAM filename'^M^J);
  39.     WRITELN(OUTPUT,'A public domain program by Rob Rosenberger (who?)'^M^J);
  40.     WRITELN(OUTPUT,'Takes a "snapshot" of RAM and sends it to the filename');
  41.     WRITELN(OUTPUT,'you specify.  You must have at least 640k of free disk');
  42.     WRITELN(OUTPUT,'space for the snapshot file.'^M^J);
  43.     HALT(0)
  44.     END;
  45.  
  46. {If we get this far, PARAMSTR(1) contains a filename.}
  47. {Open the file.}
  48. ASSIGN(PhotoFile,PARAMSTR(1));
  49. REWRITE(PhotoFile,1);
  50.  
  51. FOR Index := 0 TO ((TotalRAM DIV $40) - $1)
  52.  DO BEGIN
  53.     BLOCKWRITE(PhotoFile,PTR(Index,$0000)^,$8000);
  54.     BLOCKWRITE(PhotoFile,PTR(Index,$8000)^,$8000)
  55.     END;
  56.  
  57. CLOSE(PhotoFile)
  58. {And that's all he wrote!}
  59. END. {PhotoRAM}
  60.